#include<iostream>
#include<vector>
using namespace std;
class Solution {
public:
    void Swap(int* a, int* b) {
        int tmp = *a;
        *a = *b;
        *b = tmp;
    }

    void sortColors(vector<int>& nums) {
        int i = 0, left = -1, right = nums.size() - 1;
        while (i <= right) {
            if (nums[i] == 0) {
                Swap(&nums[++left], &nums[i++]);
            }
            else if (nums[i] == 1) {
                i++;
            }
            else {
                Swap(&nums[right--], &nums[i]);
            }
        }
    }
};
int main(){

	return 0;
}